package com.model.pool;

import com.face.ConstantDecorate;
import com.model.ClassInfo;
import com.model.structure.ConstantPool;
import com.util.Analysis;
import com.util.SystemNumber;
import lombok.Data;

/**
 * @author seven
 */
@Data
public class ConstantLongInfo  extends BaseConstantDecorate implements ConstantDecorate {

    private Long bytes;
    private Integer bytesLen=8;

    /**
     * 解析Long常量
     *
     * @param info
     */
    @Override public void invoke(ClassInfo info, Analysis analysis,int tag) {
        if (tag == SystemNumber.FIVE) {
            this.setBytes(analysis.util.sixteenToLong(analysis.readValue(this.getBytesLen())));
            this.setConstantPoolInfoType("CONSTANT_Long_info");
            this.setTag(tag);
            info.getPoolList().add(this);
        } else {
            new ConstantMethodHandleInfo().invoke(info,analysis,tag);
        }
    }
}
